package model

import (
	"gitee.com/zaiqiang231/zcamp-service-user/app/model/meta"
)

type User struct {
	meta.RecordModel
	Enable        int    `json:"enable" gorm:"default:1;comment:用户是否被冻结 1正常 2冻结"`
	Uid           int64  `json:"uid" gorm:"column:uid;unique;"`
	Name          string `json:"name" validate:"required" gorm:"index;unique;not null;comment:用户登录名"`
	Password      string `json:"-" gorm:"not null;comment:用户登录密码"`
	RegisterPhone string `json:"register_phone" gorm:"column:register_phone;comment:用户登录手机号"`
	NickName      string `json:"nick_name" gorm:"default:用户昵称;comment:用户昵称"`
	HeaderImg     string `json:"header_img" gorm:"comment:用户头像"` // json 图片
	Email         string `json:"email" gorm:"comment:用户邮箱"`
	Phone         string `json:"phone" gorm:"comment:用户手机号"`
}

func (User) TableName() string {
	return "z_user"
}

type UserMore struct {
	User
	IsPostAdmin bool `json:"is_post_admin"` //是否帖子超管
}

type NumRelation struct {
	Uid           int64 `json:"uid"`
	NumPost       int   `json:"num_post"`
	NumFans       int   `json:"num_fans"`
	NumFollowings int   `json:"num_followings"`
	NumCollect    int   `json:"num_collect"` //收藏总数
}

type RecommendFollowUserInfo struct {
	UserInfo User   `json:"user"`
	Content  string `json:"content"` // 推荐文案
	Relation string `json:"relation"`
}

type UserAdmin struct {
	meta.RecordModel
	UID       int64 `json:"uid" gorm:"column:uid;unique"`
	PostAdmin int   `json:"post_admin" gorm:"column:post_admin"`
}

func (UserAdmin) TableName() string {
	return "z_user_admin"
}
